<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>autocomplete demo</title>
        <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css">
        <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
        <script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
    </head>
    <body>
        <label for="autocomplete">Select a programming language: </label>
        <input id="autocomplete">
        <script>
           
            $( "#autocomplete" ).autocomplete({
                //                source: function( request, response ) {
                //                    console.debug(request);
                //                    console.debug(response);
                //                    $.ajax({
                //                        url: "http://dll3.lc/index.php/home/ajax_search?part="+request.term,
                //                        type: "GET",
                //                        dataType: "json",
                //                        success: function(json) {
                //                            var matcher = new RegExp( "\w" + $.ui.autocomplete.escapeRegex( request.term ), "i" );
                //                    
                //                            response( $.grep( json, function( item ){
                //                                return matcher.test( item );
                //                            }) );
                //                        }
                //                    });
                //                    
                //                }
                delay: 100,
                source: function(request, response) {
                    $.ajax({
                        url: "http://dll3.lc/index.php/home/ajax_search?part="+request.term,
                        dataType: 'json',
                        success: function(json) {		
                            response($.map(json, function(item) {
                                return item
                            }));
                            return false
                        }
                    });
                }, 
                
                focus: function(event, ui) {
                    return false;
                }
            });
        </script>
    </body>
</html>